//
// Created by Soar Qin on 2017/9/7.
// Copyright (c) 2017 Soar Qin. All rights reserved.
//

#pragma once

namespace core::async {

class KCPEndpoint;
class IPAddr;

struct KCPClientContext;

class KCPClient {
    DISABLE_CLASS_COPY(KCPClient);
public:
    explicit KCPClient(KCPEndpoint *endpoint);
    virtual ~KCPClient();

    bool init(uint32_t conv, const IPAddr &addr);
    void write(const void *buf, size_t size);

protected:
    void input(const void *buf, size_t size);

private:
    KCPClientContext *context_;

    friend class KCPEndpoint;
};

}
